import { BasicColumn } from '/@/components/Table';
import { Tag } from 'ant-design-vue';
import { t } from '/@/hooks/web/useI18n';

export function getBasicColumns(): BasicColumn[] {
  return [
    {
      title: '活动编号',
      dataIndex: 'hd_id',
      width: 60,
      align: 'left',
    },
    {
      title: '活动名称',
      dataIndex: 'hd_name',
      width: 120,
      align: 'left',
    },
    {
      title: '周期',
      dataIndex: 'hd_type',
      width: 100,
      align: 'left',
      customRender: ({ text }) => {
        if (text === 0) {
          return <Tag color="green">{() => t('天')}</Tag>;
        } else if (text === 1) {
          return <Tag color="red">{() => t('周')}</Tag>;
        } else if (text === 2) {
          return <Tag color="blue">{() => t('月')}</Tag>;
        } else if (text === 3) {
          return <Tag color="black">{() => t('季度')}</Tag>;
        }
        return <Tag color="yellow">{() => t('按时间选择')}</Tag>;
      },
    },
    {
      title: '可领取次数',
      dataIndex: 'hd_times',
      width: 120,
      align: 'left',
    },
    {
      title: '开始时间',
      dataIndex: 'begin_time',
      width: 160,
      align: 'left',
    },
    {
      title: '结束时间',
      dataIndex: 'end_time',
      width: 160,
      align: 'left',
    },
    {
      title: '支付金额',
      dataIndex: 'money',
      width: 80,
      align: 'left',
    },
    {
      title: '创建时间',
      dataIndex: 'create_time',
      width: 160,
      align: 'left',
    },
  ];
}
